package com.gupaoedu.vip;

import com.google.common.eventbus.EventBus;
import com.gupaoedu.vip.model.Teacher;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ObserverModeTest {

    public static void main(String[] args) {
        EventBus eventBus = new EventBus();
        Teacher teacher = new Teacher();
        eventBus.register(teacher);

        Map<String,Object> map = new HashMap<String,Object>();
        List<String> teacherList = new ArrayList<String>();
        teacherList.add("Tom");


        map.put("teacher",teacherList);
        map.put("student","zhangsan");
        map.put("question","常用的设计模式有哪些？");
        eventBus.post(map);
    }
}
